1010
1111
1212class Ntfy (WebHook ):
13- """Notifier for ntfy """
13+ """Notifier for Ntfy """
1414
1515 def __init__ (self , config : Config ):
1616 self .enabled = config .ntfy .get ("enabled" , False )
@@ -36,13 +36,13 @@ def __init__(self, config: Config):
3636 if not self .server or not self .topic :
3737 raise NtfyConfigurationError ()
3838 self .url = f"{ self .server } /{ self .topic } "
39- log .debug ("ntfy url: %s" , self .url )
39+ log .debug ("Ntfy url: %s" , self .url )
4040 if (self .username and self .password ) is not None :
4141 self .auth = HTTPBasicAuth (self .username , self .password )
42- log .debug ("Using basic auth with user '%s' for ntfy " ,
42+ log .debug ("Using basic auth with user '%s' for Ntfy " ,
4343 self .username )
44- else :
45- log .warning ("Username or Password missing for ntfy "
44+ elif ( self . username or self . password ) is not None :
45+ log .warning ("Username or Password missing for Ntfy "
4646 "authentication, defaulting to no auth" )
4747 try :
4848 Item .check_mask (self .title )
@@ -53,7 +53,7 @@ def __init__(self, config: Config):
5353 raise NtfyConfigurationError (exc .message ) from exc
5454
5555 def _send (self , item : Item ) -> None :
56- """Sends item information via configured ntfy endpoint"""
56+ """Sends item information via configured Ntfy endpoint"""
5757 title = item .unmask (self .title ).encode ("utf-8" )
5858 message = item .unmask (self .message ).encode ("utf-8" )
5959 tags = item .unmask (self .tags ).encode ("utf-8" )
@@ -68,4 +68,4 @@ def _send(self, item: Item) -> None:
6868 super ()._send (item )
6969
7070 def __repr__ (self ) -> str :
71- return f"ntfy : { self .server } /{ self .topic } "
71+ return f"Ntfy : { self .server } /{ self .topic } "
0 commit comments