# Path: src/alexapi/device_platforms/baseplatform.py
# class BasePlatform:
# 	__metaclass__ = ABCMeta
# 
# 	_trigger_callback = None
# 
# 	def __init__(self, config, platform_name):
# 		self._config = config
# 
# 		self._pconfig = {}
# 		if config['platforms']['common']:
# 			self._pconfig = config['platforms']['common']
# 
# 		if config['platforms'][platform_name]:
# 			self._pconfig.update(config['platforms'][platform_name])
# 
# 	@abstractmethod
# 	def setup(self):
# 		pass
# 
# 	@abstractmethod
# 	def after_setup(self, trigger_callback=None):
# 		pass
# 
# 	@abstractmethod
# 	def indicate_failure(self):
# 		pass
# 
# 	@abstractmethod
# 	def indicate_success(self):
# 		pass
# 
# 	@abstractmethod
# 	def indicate_recording(self, state=True):
# 		pass
# 
# 	@abstractmethod
# 	def indicate_playback(self, state=True):
# 		pass
# 
# 	@abstractmethod
# 	def indicate_processing(self, state=True):
# 		pass
# 
# 	@abstractmethod
# 	def force_recording(self):
# 		pass
# 
# 	@abstractmethod
# 	def cleanup(self):
# 		pass


import json
import logging
import threading
import websocket
from .baseplatform import BasePlatform
	def hyperion_message(self, command, priority=False, options=None):
		message = options or {}
		message['command'] = command
		if priority:
			message['priority'] = self._pconfig['hyperion_priority']
		return message

	def hyperion_send(self, message):
		if self._pconfig['verbose']:
			logger.debug("sending '%s'", json.dumps(message))
		if self.socket_status():
			self.socket.send(json.dumps(message))
		else:
			logger.warning("Unable to send Hyperion state update")
			self.init_connection()

	def indicate_failure(self):
		pass

	def indicate_playback(self, state=True):
		if self._pconfig['indicate_playback']:
			self.handle_indicate('playback', state)

	def indicate_processing(self, state=True):
		self.handle_indicate('processing', state)

	def indicate_recording(self, state=True):
		self.handle_indicate('recording', state)

	def indicate_success(self):

# Path: src/alexapi/device_platforms/baseplatform.py
# class BasePlatform:
# 	__metaclass__ = ABCMeta
# 
# 	_trigger_callback = None
# 
# 	def __init__(self, config, platform_name):
# 		self._config = config
# 
# 		self._pconfig = {}
# 		if config['platforms']['common']:
# 			self._pconfig = config['platforms']['common']
# 
# 		if config['platforms'][platform_name]:
# 			self._pconfig.update(config['platforms'][platform_name])
# 
# 	@abstractmethod
# 	def setup(self):
# 		pass
# 
# 	@abstractmethod
# 	def after_setup(self, trigger_callback=None):
# 		pass
# 
# 	@abstractmethod
# 	def indicate_failure(self):
# 		pass
# 
# 	@abstractmethod
# 	def indicate_success(self):
# 		pass
# 
# 	@abstractmethod
# 	def indicate_recording(self, state=True):
# 		pass
# 
# 	@abstractmethod
# 	def indicate_playback(self, state=True):
# 		pass
# 
# 	@abstractmethod
# 	def indicate_processing(self, state=True):
# 		pass
# 
# 	@abstractmethod
# 	def force_recording(self):
# 		pass
# 
# 	@abstractmethod
# 	def cleanup(self):
# 		pass


# Path: src/alexapi/device_platforms/hyperionplatform.py
import json
import logging
import threading
import websocket
from .baseplatform import BasePlatform

	def hyperion_message(self, command, priority=False, options=None):
		message = options or {}
		message['command'] = command
		if priority:
			message['priority'] = self._pconfig['hyperion_priority']
		return message

	def hyperion_send(self, message):
		if self._pconfig['verbose']:
			logger.debug("sending '%s'", json.dumps(message))
		if self.socket_status():
			self.socket.send(json.dumps(message))
		else:
			logger.warning("Unable to send Hyperion state update")
			self.init_connection()

	def indicate_failure(self):
		pass

	def indicate_playback(self, state=True):
		if self._pconfig['indicate_playback']:
			self.handle_indicate('playback', state)

	def indicate_processing(self, state=True):
		self.handle_indicate('processing', state)

	def indicate_recording(self, state=True):
		self.handle_indicate('recording', state)

	def indicate_success(self):

		pass