Skip to content

Commit

Permalink
wip:Started on class refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Jelloeater committed May 22, 2023
1 parent db93bc3 commit 3b6566b
Show file tree
Hide file tree
Showing 14 changed files with 267 additions and 567 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

n.n.n / 2023-05-15
n.n.n / 2023-05-22
==================


* Updated doc gen

v2.3.3 / 2023-05-10
===================
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,29 @@ pip install git+https://github.com/Jelloeater/hubitatcontrol.git

### API
**Local Example**

```python
import __main__
import hubitatcontrol as hc

hub = hc.get_hub(host='http://192.168.1.100', token='Maker_Token',
app_id='Maker_App_ID')
device = hc.lookup_device(hub, 'Device_Name')
hub = __main__.get_hub(host='http://192.168.1.100', token='Maker_Token',
app_id='Maker_App_ID')
device = __main__.lookup_device(hub, 'Device_Name')

print(device.switch)
device.turn_on()
print(device.switch)
```

**Cloud Example**

```python
import __main__
import hubitatcontrol as hc

hub = hc.get_hub(host='https://cloud.hubitat.com', token='Maker_Token',
app_id='Maker_App_ID', cloud_token='Cloud_API_token')
device = hc.lookup_device(hub, 'Device_Name')
hub = __main__.get_hub(host='https://cloud.hubitat.com', token='Maker_Token',
app_id='Maker_App_ID', cloud_token='Cloud_API_token')
device = __main__.lookup_device(hub, 'Device_Name')

print(device.switch)
device.turn_on()
Expand Down
38 changes: 0 additions & 38 deletions docs/classes.dot

This file was deleted.

16 changes: 8 additions & 8 deletions docs/hubitatcontrol/environment.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Module hubitatcontrol.environment
Module hubitatcontrol.environment
=================================

## Classes
Classes
-------

`Thermostat(hub: hubitatcontrol.hub.Hub, device_from_hub: dict)`
:
:

```
### Ancestors (in MRO)
### Ancestors (in MRO)

* hubitatcontrol.sensors.TemperatureSensor
* hubitatcontrol.hub.Device
```
* hubitatcontrol.sensors.TemperatureSensor
* hubitatcontrol.hub.Device
120 changes: 54 additions & 66 deletions docs/hubitatcontrol/generic.md
Original file line number Diff line number Diff line change
@@ -1,113 +1,101 @@
# Module hubitatcontrol.generic
Module hubitatcontrol.generic
=============================

## Classes
Classes
-------

`Button(hub: hubitatcontrol.hub.Hub, device_from_hub: dict)`
:
:

```
### Ancestors (in MRO)
### Ancestors (in MRO)

* hubitatcontrol.hub.Device
* hubitatcontrol.hub.Device

### Descendants
### Descendants

* hubitatcontrol.generic.SonoffZigbeeButtonController
```
* hubitatcontrol.generic.SonoffZigbeeButtonController

`EcoBee(hub: hubitatcontrol.hub.Hub, device_from_hub: dict)`
:
:

```
### Ancestors (in MRO)
### Ancestors (in MRO)

* hubitatcontrol.generic.Thermostat
* hubitatcontrol.hub.Device
```
* hubitatcontrol.generic.Thermostat
* hubitatcontrol.hub.Device

`GenericZWaveLock(hub: hubitatcontrol.hub.Hub, device_from_hub: dict)`
:
:

```
### Ancestors (in MRO)
### Ancestors (in MRO)

* hubitatcontrol.hub.Device
* hubitatcontrol.hub.Device

### Methods
### Methods

`lock(self)`
:
`lock(self)`
:

`unlock(self)`
:
```
`unlock(self)`
:

`SonoffZigbeeButtonController(hub: hubitatcontrol.hub.Hub, device_from_hub: dict)`
:
:

```
### Ancestors (in MRO)
### Ancestors (in MRO)

* hubitatcontrol.generic.Button
* hubitatcontrol.hub.Device
```
* hubitatcontrol.generic.Button
* hubitatcontrol.hub.Device

`Switch(hub: hubitatcontrol.hub.Hub, device_from_hub: dict)`
:
:

```
### Ancestors (in MRO)
### Ancestors (in MRO)

* hubitatcontrol.hub.Device
* hubitatcontrol.hub.Device

### Descendants
### Descendants

* hubitatcontrol.generic.ZigbeeOutlet
* hubitatcontrol.lights.Dimmer
* hubitatcontrol.generic.ZigbeeOutlet
* hubitatcontrol.lights.Dimmer

### Instance variables
### Instance variables

`switch: str`
: Returns either (on or off)
`switch: str`
: Returns either (on or off)

### Methods
### Methods

`turn_off(self)`
:
`turn_off(self)`
:

`turn_on(self)`
:
```
`turn_on(self)`
:

`Thermostat(hub: hubitatcontrol.hub.Hub, device_from_hub: dict)`
:
:

```
### Ancestors (in MRO)
### Ancestors (in MRO)

* hubitatcontrol.hub.Device
* hubitatcontrol.hub.Device

### Descendants
### Descendants

* hubitatcontrol.generic.EcoBee
* hubitatcontrol.generic.EcoBee

### Methods
### Methods

`set_temperature(self)`
:
```
`set_temperature(self)`
:

`ZigbeeOutlet(hub: hubitatcontrol.hub.Hub, device_from_hub: dict)`
:
:

```
### Ancestors (in MRO)
### Ancestors (in MRO)

* hubitatcontrol.generic.Switch
* hubitatcontrol.hub.Device
* hubitatcontrol.generic.Switch
* hubitatcontrol.hub.Device

### Instance variables
### Instance variables

`power: int`
: Returns power usage
```
`power: int`
: Returns power usage
68 changes: 33 additions & 35 deletions docs/hubitatcontrol/hub.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,52 @@
# Module hubitatcontrol.hub
Module hubitatcontrol.hub
=========================

## Classes
Classes
-------

`Device(hub: hubitatcontrol.hub.Hub, device_from_hub: dict)`
:
:

```
### Descendants
### Descendants

* hubitatcontrol.generic.Button
* hubitatcontrol.generic.GenericZWaveLock
* hubitatcontrol.generic.Switch
* hubitatcontrol.generic.Thermostat
* hubitatcontrol.sensors.ContactSensor
* hubitatcontrol.sensors.TemperatureSensor
* hubitatcontrol.generic.Button
* hubitatcontrol.generic.GenericZWaveLock
* hubitatcontrol.generic.Switch
* hubitatcontrol.generic.Thermostat
* hubitatcontrol.sensors.ContactSensor
* hubitatcontrol.sensors.TemperatureSensor

### Instance variables
### Instance variables

`attributes: requests.models.Response`
:
`attributes: requests.models.Response`
:

`capabilities`
:
`capabilities`
:

`commands`
:
`commands`
:

`history: requests.models.Response`
:
`history: requests.models.Response`
:

### Methods
### Methods

`send_device_command(self, command: str, secondary_command: str = None) ‑> requests.models.Response`
:
```
`send_device_command(self, command: str, secondary_command: str = None) ‑> requests.models.Response`
:

`Hub(host, token, app_id, cloud_token=None)`
:
:

```
### Instance variables
### Instance variables

`devices: list`
:
`devices: list`
:

### Methods
### Methods

`get_device(self, name: str)`
:
`get_device(self, name: str)`
:

`get_device_id(self, dev_id: int)`
:
```
`get_device_id(self, dev_id: int)`
:
Loading

0 comments on commit 3b6566b

Please sign in to comment.