mirror of
https://github.com/suaveolent/hoymiles-wifi.git
synced 2024-09-20 03:10:11 +00:00
add ip address as command line parameter
This commit is contained in:
parent
76e59c9b6d
commit
2d42c2f9bc
@ -15,7 +15,7 @@ You can integrate the library into your own project, or simply use it in the com
|
||||
### Command line:
|
||||
|
||||
```
|
||||
hoymiles-wifi
|
||||
hoymiles-wifi <ip_address>
|
||||
```
|
||||
|
||||
This will retrieve the current inverter state.
|
||||
@ -25,7 +25,7 @@ This will retrieve the current inverter state.
|
||||
```
|
||||
from hoymiles_wifi.inverter import Inverter
|
||||
|
||||
inverter = Inverter('192.168.1.190')
|
||||
inverter = Inverter(<ip_address>)
|
||||
response = inverter.update_state()
|
||||
|
||||
if response:
|
||||
|
@ -1,9 +1,13 @@
|
||||
import argparse
|
||||
from hoymiles_wifi.inverter import Inverter
|
||||
import time
|
||||
|
||||
def main():
|
||||
# Replace 'your_inverter_ip' with the actual IP address or hostname of your inverter
|
||||
inverter = Inverter('192.168.1.190')
|
||||
parser = argparse.ArgumentParser(description="Hoymiles HMS Monitoring")
|
||||
parser.add_argument("ip_address", type=str, help="IP address or hostname of the inverter")
|
||||
args = parser.parse_args()
|
||||
|
||||
inverter = Inverter(args.ip_address)
|
||||
|
||||
try:
|
||||
while True:
|
||||
|
Loading…
Reference in New Issue
Block a user