-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
benning #1371
Merged
Merged
benning #1371
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env python3 | ||
from typing import Optional | ||
from helpermodules.auto_str import auto_str | ||
from modules.devices.json.config import Json, JsonConfiguration, JsonInverterConfiguration, JsonInverterSetup | ||
|
||
|
||
@auto_str | ||
class BenningConfiguration(JsonConfiguration): | ||
def __init__(self, url: Optional[str] = None): | ||
self.url = "http://" + url + "/getentries.cgi?oids=11369,19000" | ||
|
||
|
||
@auto_str | ||
class Benning(Json): | ||
def __init__(self, | ||
name: str = "Benning", | ||
type: str = "benning", | ||
id: int = 0, | ||
configuration: BenningConfiguration = None) -> None: | ||
super().__init__(name, type, id, configuration) | ||
|
||
|
||
@auto_str | ||
class BenningInverterConfiguration: | ||
def __init__(self): | ||
pass | ||
|
||
|
||
@auto_str | ||
class BenningInverterSetup(JsonInverterSetup): | ||
def __init__(self, | ||
name: str = "Benning Wechselrichter", | ||
type: str = "inverter", | ||
id: int = 0, | ||
configuration: JsonInverterConfiguration = None) -> None: | ||
super().__init__(name, type, id, JsonInverterConfiguration( | ||
jq_power=".[]|select(.oid==11365)|.val|tonumber", jq_exported=".[]|select(.oid==19000)|.val|tonumber")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env python3 | ||
import logging | ||
from modules.common.abstract_device import DeviceDescriptor | ||
from modules.devices.benning.config import Benning | ||
from modules.devices.json.device import create_device as create_device_json | ||
log = logging.getLogger(__name__) | ||
|
||
|
||
def create_device(device_config: Benning): | ||
return create_device_json(device_config) | ||
|
||
|
||
device_descriptor = DeviceDescriptor(configuration_factory=Benning) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env python3 | ||
from modules.common.component_type import ComponentDescriptor | ||
from modules.devices.benning.config import BenningInverterSetup | ||
|
||
|
||
component_descriptor = ComponentDescriptor(configuration_factory=BenningInverterSetup) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,37 @@ | ||||||||||
#!/usr/bin/env python3 | ||||||||||
from typing import Optional | ||||||||||
from helpermodules.auto_str import auto_str | ||||||||||
from modules.devices.json.config import Json, JsonConfiguration, JsonInverterConfiguration, JsonInverterSetup | ||||||||||
|
||||||||||
|
||||||||||
@auto_str | ||||||||||
class OpenDTUConfiguration(JsonConfiguration): | ||||||||||
def __init__(self, url: Optional[str] = None): | ||||||||||
self.url = "http://" + url + "/api/livedata/status" | ||||||||||
|
||||||||||
|
||||||||||
@auto_str | ||||||||||
class OpenDTU(Json): | ||||||||||
def __init__(self, | ||||||||||
name: str = "OpenDTU", | ||||||||||
type: str = "opendtu", | ||||||||||
id: int = 0, | ||||||||||
configuration: OpenDTUConfiguration = None) -> None: | ||||||||||
super().__init__(name, type, id, configuration) | ||||||||||
|
||||||||||
|
||||||||||
@auto_str | ||||||||||
class OpenDTUInverterConfiguration: | ||||||||||
def __init__(self): | ||||||||||
pass | ||||||||||
Comment on lines
+23
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Auf diese Klasse wird nicht zugegriffen. |
||||||||||
|
||||||||||
|
||||||||||
@auto_str | ||||||||||
class OpenDTUInverterSetup(JsonInverterSetup): | ||||||||||
def __init__(self, | ||||||||||
name: str = "Hoymiles Wechselrichter", | ||||||||||
type: str = "inverter", | ||||||||||
id: int = 0, | ||||||||||
configuration: JsonInverterConfiguration = None) -> None: | ||||||||||
super().__init__(name, type, id, JsonInverterConfiguration( | ||||||||||
jq_power=".total.Power.v", jq_exported=".total.YieldTotal.v*1000")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env python3 | ||
import logging | ||
from modules.common.abstract_device import DeviceDescriptor | ||
from modules.devices.opendtu.config import OpenDTU | ||
from modules.devices.json.device import create_device as create_device_json | ||
log = logging.getLogger(__name__) | ||
|
||
|
||
def create_device(device_config: OpenDTU): | ||
return create_device_json(device_config) | ||
|
||
|
||
device_descriptor = DeviceDescriptor(configuration_factory=OpenDTU) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env python3 | ||
from modules.common.component_type import ComponentDescriptor | ||
from modules.devices.opendtu.config import OpenDTUInverterSetup | ||
|
||
|
||
component_descriptor = ComponentDescriptor(configuration_factory=OpenDTUInverterSetup) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auf diese Klasse wird nicht zugegriffen.