Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.twitter.notify.TwitterNotificationService Class Reference
Inheritance diagram for homeassistant.components.twitter.notify.TwitterNotificationService:
[legend]
Collaboration diagram for homeassistant.components.twitter.notify.TwitterNotificationService:
[legend]

Public Member Functions

def __init__ (self, hass, consumer_key, consumer_secret, access_token_key, access_token_secret, username)
 
None check_status_until_done (self, media_id, callback, *args)
 
def media_info (self, media_path)
 
def send_message (self, message="", **kwargs)
 
def send_message_callback (self, message, user, media_id=None)
 
def upload_media_append (self, chunk, media_id, segment_id)
 
def upload_media_chunked (self, file, total_bytes, media_id)
 
def upload_media_finalize (self, media_id)
 
def upload_media_init (self, media_type, media_category, total_bytes)
 
None upload_media_then_callback (self, callback, media_path=None)
 

Static Public Member Functions

def log_bytes_sent (bytes_sent, total_bytes)
 
def log_error_resp (resp)
 
def log_error_resp_append (resp)
 
def media_category_for_type (media_type)
 

Public Attributes

 api
 
 default_user
 
 hass
 

Detailed Description

Implementation of a notification service for the Twitter service.

Definition at line 63 of file notify.py.

Constructor & Destructor Documentation

◆ __init__()

def homeassistant.components.twitter.notify.TwitterNotificationService.__init__ (   self,
  hass,
  consumer_key,
  consumer_secret,
  access_token_key,
  access_token_secret,
  username 
)
Initialize the service.

Definition at line 66 of file notify.py.

Member Function Documentation

◆ check_status_until_done()

None homeassistant.components.twitter.notify.TwitterNotificationService.check_status_until_done (   self,
  media_id,
  callback,
args 
)
Upload media, STATUS phase.

Definition at line 214 of file notify.py.

◆ log_bytes_sent()

def homeassistant.components.twitter.notify.TwitterNotificationService.log_bytes_sent (   bytes_sent,
  total_bytes 
)
static
Log upload progress.

Definition at line 256 of file notify.py.

◆ log_error_resp()

def homeassistant.components.twitter.notify.TwitterNotificationService.log_error_resp (   resp)
static
Log error response.

Definition at line 261 of file notify.py.

◆ log_error_resp_append()

def homeassistant.components.twitter.notify.TwitterNotificationService.log_error_resp_append (   resp)
static
Log error response, during upload append phase.

Definition at line 273 of file notify.py.

◆ media_category_for_type()

def homeassistant.components.twitter.notify.TwitterNotificationService.media_category_for_type (   media_type)
static
Determine Twitter media category by mime type.

Definition at line 241 of file notify.py.

◆ media_info()

def homeassistant.components.twitter.notify.TwitterNotificationService.media_info (   self,
  media_path 
)
Determine mime type and Twitter media category for given media.

Definition at line 161 of file notify.py.

◆ send_message()

def homeassistant.components.twitter.notify.TwitterNotificationService.send_message (   self,
  message = "",
**  kwargs 
)
Tweet a message, optionally with media.

Definition at line 82 of file notify.py.

◆ send_message_callback()

def homeassistant.components.twitter.notify.TwitterNotificationService.send_message_callback (   self,
  message,
  user,
  media_id = None 
)
Tweet a message, optionally with media.

Definition at line 102 of file notify.py.

◆ upload_media_append()

def homeassistant.components.twitter.notify.TwitterNotificationService.upload_media_append (   self,
  chunk,
  media_id,
  segment_id 
)
Upload media, APPEND phase.

Definition at line 200 of file notify.py.

◆ upload_media_chunked()

def homeassistant.components.twitter.notify.TwitterNotificationService.upload_media_chunked (   self,
  file,
  total_bytes,
  media_id 
)
Upload media, chunked append.

Definition at line 185 of file notify.py.

◆ upload_media_finalize()

def homeassistant.components.twitter.notify.TwitterNotificationService.upload_media_finalize (   self,
  media_id 
)
Upload media, FINALIZE phase.

Definition at line 208 of file notify.py.

◆ upload_media_init()

def homeassistant.components.twitter.notify.TwitterNotificationService.upload_media_init (   self,
  media_type,
  media_category,
  total_bytes 
)
Upload media, INIT phase.

Definition at line 173 of file notify.py.

◆ upload_media_then_callback()

None homeassistant.components.twitter.notify.TwitterNotificationService.upload_media_then_callback (   self,
  callback,
  media_path = None 
)
Upload media.

Definition at line 132 of file notify.py.

Member Data Documentation

◆ api

homeassistant.components.twitter.notify.TwitterNotificationService.api

Definition at line 78 of file notify.py.

◆ default_user

homeassistant.components.twitter.notify.TwitterNotificationService.default_user

Definition at line 76 of file notify.py.

◆ hass

homeassistant.components.twitter.notify.TwitterNotificationService.hass

Definition at line 77 of file notify.py.


The documentation for this class was generated from the following file: