Plugin API

Post Reply
Dog2puppy
Newbie
Newbie
Posts: 4
Joined: Sat Sep 02, 2017 3:32 pm
Station model: AcuRite PRO+ 5-in-1
Software: Wunderground

Plugin API

Post by Dog2puppy » Sun Sep 03, 2017 12:41 am

Something I would like to see with Meteotemplate is a extensive plugin API. API should be Object-Oriented, and should allow for lots of customization.
Image

User avatar
Jachym
Site Admin
Site Admin
Posts: 1686
Joined: Fri Aug 18, 2017 10:12 pm
Location: Brno, Czech Republic
Station model: WH1080
Software: Meteobridge
Contact:

Re: Plugin API

Post by Jachym » Sun Sep 03, 2017 11:03 am

HI,
sorry, no clue what you mean by Plugin API. What should such plugin do? The API already supports all the sensors I could think of and you can send to it any data you want and set it in the extra sensors section.

OOP is something I dont use, for the purposes of MT and the way it is used it is not optimal.

Dog2puppy
Newbie
Newbie
Posts: 4
Joined: Sat Sep 02, 2017 3:32 pm
Station model: AcuRite PRO+ 5-in-1
Software: Wunderground

Re: Plugin API

Post by Dog2puppy » Sun Sep 03, 2017 12:22 pm

Jachym wrote: Sun Sep 03, 2017 11:03 am HI,
sorry, no clue what you mean by Plugin API. What should such plugin do? The API already supports all the sensors I could think of and you can send to it any data you want and set it in the extra sensors section.

OOP is something I dont use, for the purposes of MT and the way it is used it is not optimal.
By plugin API, I just mean a way to ingrate into Meteotemplate. For example, to get the wind speed I might do this.

Code: Select all

<?php
class MyPlugin extends Plugin {
  $windspeed = $meteotemplate->getCurrentConditions()->getWindSpeed(); //Get wind speed
  echo $windspeed; //Result
Image

User avatar
Jachym
Site Admin
Site Admin
Posts: 1686
Joined: Fri Aug 18, 2017 10:12 pm
Location: Brno, Czech Republic
Station model: WH1080
Software: Meteobridge
Contact:

Re: Plugin API

Post by Jachym » Sun Sep 03, 2017 12:29 pm

Right I see,
the entire template is done in a procedural style, not objective.

What you want can easily be achieved using the stationFeed plugin, which gives you the data in both JSON and XML format

Dog2puppy
Newbie
Newbie
Posts: 4
Joined: Sat Sep 02, 2017 3:32 pm
Station model: AcuRite PRO+ 5-in-1
Software: Wunderground

Re: Plugin API

Post by Dog2puppy » Sat Sep 09, 2017 5:19 pm

The thing is, I would like to see a expandable system. The way it is now is fine, but in a future update a plugin API would be nice.
Image

User avatar
Jachym
Site Admin
Site Admin
Posts: 1686
Joined: Fri Aug 18, 2017 10:12 pm
Location: Brno, Czech Republic
Station model: WH1080
Software: Meteobridge
Contact:

Re: Plugin API

Post by Jachym » Sat Sep 09, 2017 5:20 pm

Hi,
as I explained what you are suggesting cannot work, simply because there is nothing to "extend", no part of the template (with the exception of one plugin, which was more like an experiment) is using OOP, so you cant just build it from scratch.

I still think the dataFeed plugin does what you need

Dog2puppy
Newbie
Newbie
Posts: 4
Joined: Sat Sep 02, 2017 3:32 pm
Station model: AcuRite PRO+ 5-in-1
Software: Wunderground

Re: Plugin API

Post by Dog2puppy » Sat Sep 09, 2017 5:35 pm

Jachym wrote: Sat Sep 09, 2017 5:20 pm Hi,
as I explained what you are suggesting cannot work, simply because there is nothing to "extend", no part of the template (with the exception of one plugin, which was more like an experiment) is using OOP, so you cant just build it from scratch.

I still think the dataFeed plugin does what you need
Yes, the datafeed plugin would work, just that in a future update a full api would be nice. There's already the API for updating the data.
Image

User avatar
Jachym
Site Admin
Site Admin
Posts: 1686
Joined: Fri Aug 18, 2017 10:12 pm
Location: Brno, Czech Republic
Station model: WH1080
Software: Meteobridge
Contact:

Re: Plugin API

Post by Jachym » Sat Sep 09, 2017 5:56 pm

But how do you want to make an API when the whole thing is programmed completely differently to what you are proposing

Post Reply