Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Commit

Permalink
Add manufacturer
Browse files Browse the repository at this point in the history
  • Loading branch information
peternijssen committed Dec 8, 2020
1 parent 0b83940 commit 79e6fb2
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='spiderpy',
version='1.4.1',
version='1.4.2',
description='Python wrapper for the Spider API, a way to manage your Spider installation',
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
4 changes: 4 additions & 0 deletions spiderpy/devices/base.py
Expand Up @@ -15,6 +15,10 @@ def name(self):
def model(self):
return self.data.get('model')

@property
def manufacturer(self):
return self.data.get('manufacturer')

@property
def type(self):
# 105 == Thermostat
Expand Down
2 changes: 1 addition & 1 deletion spiderpy/devices/powerplug.py
Expand Up @@ -30,4 +30,4 @@ def turn_off(self):
self.api.turn_power_plug_off(self.id)

def __str__(self):
return f"{self.id} {self.name} {self.model} {self.type} {self.is_online} {self.is_on} {self.is_available} {self.current_energy_consumption} {self.today_energy_consumption}"
return f"{self.id} {self.name} {self.model} {self.manufacturer} {self.type} {self.is_online} {self.is_on} {self.is_available} {self.current_energy_consumption} {self.today_energy_consumption}"
2 changes: 1 addition & 1 deletion spiderpy/devices/thermostat.py
Expand Up @@ -91,4 +91,4 @@ def set_fan_speed(self, fanspeed):
self.api.set_fan_speed(self.data, fanspeed)

def __str__(self):
return f"{self.id} {self.name} {self.model} {self.type} {self.is_online} {self.operation_mode} {self.has_operation_mode} {self.has_fan_mode} {self.current_temperature} {self.target_temperature} {self.minimum_temperature} {self.maximum_temperature} {self.temperature_steps} {self.current_fan_speed}"
return f"{self.id} {self.name} {self.model} {self.manufacturer} {self.type} {self.is_online} {self.operation_mode} {self.has_operation_mode} {self.has_fan_mode} {self.current_temperature} {self.target_temperature} {self.minimum_temperature} {self.maximum_temperature} {self.temperature_steps} {self.current_fan_speed}"
2 changes: 1 addition & 1 deletion spiderpy/spiderapi.py
Expand Up @@ -110,7 +110,7 @@ def set_operation_mode(self, thermostat, mode):
return self._request_action(url, json.dumps(thermostat))

def set_fan_speed(self, thermostat, fanspeed):
""" Set the fanspeed. Unfortunately, the API requires the complete object"""
""" Set the fan speed. Unfortunately, the API requires the complete object"""
self._reset_status_modified(thermostat) # Make sure only fan speed will be modified
for key, prop in enumerate(thermostat['properties']):
# noinspection SpellCheckingInspection
Expand Down

0 comments on commit 79e6fb2

Please sign in to comment.