Skip to content

Add additional parameters to NUT UPS sensor#15066

Merged
fabaff merged 4 commits intohome-assistant:devfrom
carlchan:dev
Jun 30, 2018
Merged

Add additional parameters to NUT UPS sensor#15066
fabaff merged 4 commits intohome-assistant:devfrom
carlchan:dev

Conversation

@carlchan
Copy link
Copy Markdown
Contributor

@carlchan carlchan commented Jun 20, 2018

Description:

Added additional parameters to NUT UPS sensor
input.frequency
output.current
output.voltage
output.frequency

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#5623

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

Added input.frequency and a number of output parameters.
@homeassistant
Copy link
Copy Markdown
Contributor

Hi @carlchan,

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

@ghost ghost added the in progress label Jun 20, 2018
'output.voltage': ['Output Voltage', 'V', 'mdi:flash'],
'output.voltage.nominal': ['Nominal Output Voltage', 'V', 'mdi:flash'],
'output.frequency': ['Output Frequency', 'hz', 'mdi:flash'],
'output.frequency.nominal': ['Nominal Output Frequency', 'hz', 'mdi:flash'],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (80 > 79 characters)

'input.voltage.nominal': ['Nominal Input Voltage', 'V', 'mdi:flash'],
'input.frequency': ['Input Line Frequency','hz','mdi:flash'],
'input.frequency.nominal': ['Nominal Input Line Frequency','hz','mdi:flash'],
'input.frequency.status': ['Input Frequency Status','','mdi:information-outline'],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ','
line too long (86 > 79 characters)

'input.voltage': ['Input Voltage', 'V', 'mdi:flash'],
'input.voltage.nominal': ['Nominal Input Voltage', 'V', 'mdi:flash'],
'input.frequency': ['Input Line Frequency','hz','mdi:flash'],
'input.frequency.nominal': ['Nominal Input Line Frequency','hz','mdi:flash'],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ','
line too long (81 > 79 characters)

['Voltage Transfer Reason', '', 'mdi:information-outline'],
'input.voltage': ['Input Voltage', 'V', 'mdi:flash'],
'input.voltage.nominal': ['Nominal Input Voltage', 'V', 'mdi:flash'],
'input.frequency': ['Input Line Frequency','hz','mdi:flash'],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ','

Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the hound and lint issues and we can merge this.

Fixed formatting issues
Added "devices" fields
'device.mfr': ['Device manufacturer', '', 'mdi:information-outline'],
'device.serial': ['Device serial', '', 'mdi:information-outline'],
'device.type': ['Device type', '', 'mdi:information-outline'],
'device.description': ['Device description', '', 'mdi:information-outline'],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is too long. Do a line break.

['Device physical location', '', 'mdi:information-outline'],
'device.part': ['Device part number', '', 'mdi:information-outline'],
'device.macaddr':
['Device network address', '', 'mdi:information-outline'],
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of these above are static information about the device and should not be added as sensors. We will probably soon implement a "device" concept related to each entity where this type of information can be stored. But we shouldn't add it to the state machine as entity states at this point.

See home-assistant/architecture#36.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Will remove.

Removed device.* sensors
Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@MartinHjelmare MartinHjelmare changed the title Update nut.py Add additional parameters to NUT UPS sensor Jun 28, 2018
@MartinHjelmare
Copy link
Copy Markdown
Member

Would be good to also list the new options in the documentation.

@fabaff fabaff merged commit c5ceb40 into home-assistant:dev Jun 30, 2018
@ghost ghost removed the in progress label Jun 30, 2018
awarecan pushed a commit to awarecan/home-assistant that referenced this pull request Jul 16, 2018
* Update nut.py

Added input.frequency and a number of output parameters.

* Update nut.py

Fixed formatting issues
Added "devices" fields

* Separated "device.description" line to two lines.

* Update nut.py

Removed device.* sensors
@balloob balloob mentioned this pull request Jul 20, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Dec 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants