Remove unneeded closer interface
This commit is contained in:
parent
baf2f68b88
commit
c92e8669cc
7 changed files with 0 additions and 28 deletions
|
|
@ -111,8 +111,3 @@ type VehicleRange interface {
|
|||
type Climater interface {
|
||||
Climater() (active bool, outsideTemp float64, targetTemp float64, err error)
|
||||
}
|
||||
|
||||
// Closer ends open sessions or connections
|
||||
type Closer interface {
|
||||
Close() error
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,12 +32,9 @@ func runCharger(cmd *cobra.Command, args []string) {
|
|||
}
|
||||
|
||||
if err := cp.configureChargers(conf); err != nil {
|
||||
cp.Close() // cleanup any open sessions
|
||||
log.FATAL.Fatal(err)
|
||||
}
|
||||
|
||||
defer cp.Close() // cleanup on exit
|
||||
|
||||
chargers := cp.chargers
|
||||
if len(args) == 1 {
|
||||
arg := args[0]
|
||||
|
|
|
|||
|
|
@ -152,12 +152,3 @@ func (cp *ConfigProvider) configureVehicles(conf config) error {
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
// Close performs cleanup activities on all entities maintained by the config provider
|
||||
func (cp *ConfigProvider) Close() {
|
||||
for _, o := range cp.vehicles {
|
||||
if c, ok := o.(api.Closer); ok {
|
||||
c.Close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,12 +35,9 @@ func runDump(cmd *cobra.Command, args []string) {
|
|||
|
||||
site, err := loadConfig(conf)
|
||||
if err != nil {
|
||||
cp.Close() // cleanup any open sessions
|
||||
log.FATAL.Fatal(err)
|
||||
}
|
||||
|
||||
defer cp.Close() // cleanup on exit
|
||||
|
||||
d := dumper{len: 2}
|
||||
|
||||
d.Header("config", "=")
|
||||
|
|
|
|||
|
|
@ -32,12 +32,9 @@ func runMeter(cmd *cobra.Command, args []string) {
|
|||
}
|
||||
|
||||
if err := cp.configureMeters(conf); err != nil {
|
||||
cp.Close() // cleanup any open sessions
|
||||
log.FATAL.Fatal(err)
|
||||
}
|
||||
|
||||
defer cp.Close() // cleanup on exit
|
||||
|
||||
meters := cp.meters
|
||||
if len(args) == 1 {
|
||||
arg := args[0]
|
||||
|
|
|
|||
|
|
@ -161,7 +161,6 @@ func run(cmd *cobra.Command, args []string) {
|
|||
// setup loadpoints
|
||||
site, err := loadConfig(conf)
|
||||
if err != nil {
|
||||
cp.Close()
|
||||
log.FATAL.Fatal(err)
|
||||
}
|
||||
|
||||
|
|
@ -236,7 +235,6 @@ func run(cmd *cobra.Command, args []string) {
|
|||
<-signalC // wait for signal
|
||||
close(stopC) // signal loop to end
|
||||
<-exitC // wait for loop to end
|
||||
cp.Close() // cleanup
|
||||
|
||||
os.Exit(1)
|
||||
}()
|
||||
|
|
|
|||
|
|
@ -32,12 +32,9 @@ func runVehicle(cmd *cobra.Command, args []string) {
|
|||
}
|
||||
|
||||
if err := cp.configureVehicles(conf); err != nil {
|
||||
cp.Close() // cleanup any open sessions
|
||||
log.FATAL.Fatal(err)
|
||||
}
|
||||
|
||||
defer cp.Close() // cleanup on exit
|
||||
|
||||
vehicles := cp.vehicles
|
||||
if len(args) == 1 {
|
||||
arg := args[0]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue